<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <style type="text/css">
				.form-groups {
				    width: 45%;
				     margin-right: 15px; 
				    margin-left: 15px; 
				    margin-bottom: 15px;  
				}
				.col-lg-9s {
				    width: 65%;
				}
				.left{
					float:left;
				}
				.right{
					float:right;
				}
				.col-lgs{
					width: 35%;
					padding-right: 15px; 
				}
				input{
					text-indent:10px;
					height: 30px;
					width: 80%;
					border-radius:5px;
				}
				input[disabled],input:disabled{
					border:1px solid #DDD;
					background-color:#F5F5F5;
					color:#ACA899;
				}
				.tts{
					margin-right: 30px; 
				}
</style>
<script type="text/javascript">

$(function(){
	//初始化表单验证
	$("#addForm").validate({
		rules:{
			passwordConfirm: {
				equalTo: "#passwordOld"
			},
			phonenumber: {
				isMobile:true
			}
		},
		messages:{
			username: {required: "请输入用户名"},
			password: {required: "请输入密码"},
			passwordConfirm: {required: "请再次输入密码",equalTo: "两次密码输入不相同"},
			trueName: {required: "请输入真实姓名"},
			phonenumber: {required: "请输入手机号码",isMobile: "请输入正确的手机号码"}
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case 3:
						Kit.alert("用户名已经存在");return;
					/* case 9:
						Kit.alert("请选择归属分公司");return; */
					case 10:
						Kit.alert("该手机号已注册，请更换手机号");return;
					case 11:
						Kit.alert("请选择归属分公司");return;
					case -1:
						Kit.alert("网络繁忙...，请重试");return;
					case 0:
						dataPaginator.loadPage(1);
						addDialog.close();
					}
				}
			});
		}
	});
});

</script>
<form id="addForm" action="${BASE_PATH}/auth/admin/doAdd" method="post" class="form-horizontal" >
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">账号：</label>
		    <div class="col-lg-9s right">
	        	<input type="text"  class="form-user" name="username" value=""  placeholder="请输入账号" required maxlength="20"  >
		    </div>
		</div>
		
		<div class="form-groups right">
		    <label class="col-lgs control-label left">真实姓名：</label>
		    <div class="col-lg-9s right">
	        	<input type="text" name="trueName" id="" value="" class="form-user" placeholder="请输入真实姓名" required maxlength="11"  >
		    </div>
		</div>
	</div>
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">密码：</label>
		    <div class="col-lg-9s right">
	        	<input type="password"  class="form-user" id="passwordOld" name="password" value=""  placeholder="请输入密码" required   >
		    </div>
		</div>
		
		<div class="form-groups right">
		    <label class="col-lgs control-label left">确认密码：</label>
		    <div class="col-lg-9s right">
	        	<input type="password"  class="form-user"id="passwordConfirm" name="passwordConfirm" value=""  placeholder="请再次输入密码" required   >
		    </div>
		</div>
	</div>
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">员工性别：</label>
		    <div class="col-lg-9s right">
	        <select name="sex" class="selectpicker form-user">
				<option value="1">男</option>
				<option value="0">女</option>
	        </select>
		    </div>
		</div>
		<div class="form-groups right">
		    <label class="col-lgs control-label left">所属分公司：</label>
		  
		   <c:if test="${roid==2}">
			    <div class="col-lg-9s right">
		        	  <select id="sStoreId" name="storeid" class="selectpicker form-user" data-width="80%" data-url="${BASE_PATH}/api/Orderstore/${sellerId}" data-isfirst="true" required data-key="storeid:title"></select> 
			    </div>
		    </c:if>
		    <c:if test="${roid==3}">
			    <div class="col-lg-9s right">
		        	    <input type="text" name="" value="${title}" class="form-user" placeholder="" disabled="disabled" maxlength="11">
		                <input type="hidden" name="storeid" value="${storeid}" class="form-user" placeholder="" maxlength="11">  
			    </div>
		    </c:if>
		</div>
	</div>
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">联系方式：</label>
		    <div class="col-lg-9s right">
	         <input type="text" class="form-user" name="phonenumber" value="" class="form-control" placeholder="请输入手机号码" required maxlength="11" >
		    </div>
		</div>
	   <div class="form-groups right">
		    <label class="col-lgs control-label left">当前状态：</label>
		    <div class="col-lg-9s right">
	        <select name="enabled" class="selectpicker ">
				<option value="1">可用</option>
				<option value="0">禁用</option>
	        </select>
		    </div>
		</div>
	</div>
	<div class="row">
	   <div class="form-groups right">
		    <label class="col-lgs control-label left">会员管理：</label>
		    <div class="col-lg-9s right">
		        <select name="VipPower" class="selectpicker ">
					<option value="0">禁用</option>
			         <c:if test="${VipPower==1}">
						<option value="1">可用</option>
					</c:if>
		        </select>
		    </div>
		</div>
		<div class="form-groups left">
		    <label class="col-lgs control-label left">员工贡献分：</label>
		    <div class="col-lg-9s right">
	        	<input type="text" name="contribution" id="phone" value="" class="form-user" placeholder="" required maxlength="11"  >
		    </div>
		</div>
	</div>
	
	<div class="row">
		<div class="form-groups right">
			
			<button class="btn btn-primary tts" type="submit" autocomplete="off">保存</button>
			<button class="btn btn-default" type="button" onclick="javascript:addDialog.close();" autocomplete="off">取消</button>
		
		</div>
	</div>
	<input type="hidden" name="Roid"  value="${roid}"/>  
</form>
